/*
 * @Author: HeAo
 * @Date: 2022-08-18 09:11:50
 * @LastEditTime: 2022-08-18 11:05:10
 * @LastEditors: HeAo
 * @Description: 
 * @FilePath: \老师的代码\ES5-day08\04-使用new去创建string.js
 * 别乱动！
 */
// 通过构造函数创建一个字符串
var str = new String('hello')
str.name = 'zhangsan'
str.age = 20
str.sayName = function () {
  console.log(this.name);
}

str.sayName() //zhangsan
console.log(typeof str); //object
console.log(str); //str对象
console.log(str.name); //zhangsan